// Copyright (c) 2010, Anthony Cassidy
// All rights reserved.
// 
// Redistribution and use in source and binary forms, with or without modification, are 
// permitted provided that the following conditions are met:
// 
//     * Redistributions of source code must retain the above copyright notice, this list 
//         of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright notice, this 
//         list of conditions and the following disclaimer in the documentation and/or 
//         other materials provided with the distribution.
//     * Neither the name of the AntsAdventureGameCreator nor the names of its contributors 
//         may be used to endorse or promote products derived from this software without 
//         specific prior written permission.
// 
// 
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
// THE POSSIBILITY OF SUCH DAMAGE.

/*!
@page Example4
<h1>Example 4 - Walking around </h1>
<img src = "Example4.png">
<h2>Summary</h2>
This example shows how to allow the player to walk a man around the screen.
<h2>Steps</h2>
The basic steps for this are:


<h2> 1. Specify the walking animations in the OnEnterRoom event </h2>
The behaviour is achieved by implementing two handlers.
Firstly the code in OnEnterRoom() event handler is called when the room
is entered. This is a good time to do any initialization, because the
player will not notice any pause between switching rooms.
<br>
<br>
Walking is a special action, in the sense that when
RoomObject::WalkTo() is called the animation
that is played whilst walking to the new position is
calculated by the engine. The engine uses various special
animations as defined by the SpecialAnimation enumeration.
<br>
<br>
These special animations are set using the
Animation::SetAsSpecialAnimation() method.
<br>
<br>
For walking, the animations that the engine will use are
those that have been set for North, East, South, and West.
<br>
<br>
In the main4.cpp example, the North, East, South and West animations
are set to "walk_up", "walk_down", "walk_left" , and "walk_right" respectively.
Each of these animations corresponds to an animation folder. In this case since
they are being Set on the "man" object, the engine will look for
folder containing both the word "man" and the "walk_xxx"
term, separated by a comma (,).



<h2> 2. Handle the Command "Walk to Pavement" by commanding the man to walk </h2>
The second handler with code added is On CommandLineExecute.
This handler is called when the user executes a command.
<br>
<br>
For a description of its parameters IEventHandlers::OnCommandLineExecute()
<br>
<br>
Of the eleven menbers of the @ref VerbEnumeration we are only interested in Walk.
We only want to allow walking on the "pavement" object, so we add
a condition to only walk when objA =="pavement". 
(See @ref Example6 for how to use custom verbs)
<br>
<br>
Walk is a verb that only needs one object to execute, and so
we can ignore the objectB parameter.
<br>
<br>
For most actions, the x and y parameters are not useful.
But for walking, they
are very useful because we can plug them
straight in to the RoomObject::WalkTo() method.
<br>
<br>

You can see the resultant code in main4.cpp.
@includelineno main4.cpp
<br>
<br>
<br>
Back to @ref Example3
On to @ref Example5...
*/

